<template>
  <m-page>
    <!-- 申请用款记录 -->
    <m-header title="申请用款记录"></m-header>
    <div class="applyRecord">
      <ynet-tab-bar v-model="current" :items="items" :ink-length="20"></ynet-tab-bar>
      <!-- 已放款 -->
      <div class="lendMoney" v-if="current === 1">
        <div class="lendMoneyItem" v-for="(item , index) in list" :key="index">
          <div class="lendMoneyInfo">
            <p class="p1">
              借款
              <span>
                ￥
                <ynet-amount :value="item.lendMoney" has-separator />
              </span>
            </p>
            <p class="p2" v-if="item.remain">
              剩余应还
              <span>
                ￥
                <ynet-amount :value="item.remain" has-separator />
              </span>
            </p>
            <p class="p3" v-if="item.rates">
              含逾期利息
              <span>
                ￥
                <ynet-amount :value="item.rates" has-separator />
              </span>
            </p>
            <p class="p4">
              <span>{{item.startDate}}</span>
              至
              <span>{{item.endDate}}</span>
            </p>
          </div>
          <div class="arrow">
            <span class="arrow-left1" v-if="item.type === '1'">已逾期3天</span>
            <span class="arrow-left2" v-if="item.type === '2'">已结清</span>
            <ynet-icon name="arrow-right" size="md"></ynet-icon>
          </div>
        </div>
      </div>
      <!-- 未放款 -->
      <div class="nolendMoney" v-if="current === 2">
        <!-- <ynet-cell-item v-for="item in listNo" :key="item.id" :brief="item.date" arrow >
          <span slot="left" >借款</span>
          <span slot="default">￥<ynet-amount :value="item.money" has-separator/></span>
          <span slot="right" v-if="item.type === '1'">待确认放款</span>
          <span slot="right" v-if="item.type === '2'">审核中</span>
          <span slot="right" v-if="item.type === '3'">未通过</span>
          <span slot="right" v-if="item.type === '4'">已取消</span>
        </ynet-cell-item> -->
        <div class="noLendItem">
          
        </div>
      </div>
    </div>
  </m-page>
</template>

<script>
import { TabBar, CellItem, Icon, Amount } from "ynet-mobile";
export default {
  components: {
    [TabBar.name]: TabBar,
    [CellItem.name]: CellItem,
    [Icon.name]: Icon,
    [Amount.name]: Amount
  },
  data() {
    return {
      current: 1, //tab_bar 当前选中
      items: [
        // tab-bar 标签标题数组
        { name: 1, label: "已放款" },
        { name: 2, label: "未放款" }
      ],
      list: [
        // 已放款列表数据
        {
          lendMoney: "300000", //借款金额
          remain: "200000", //剩余应还
          rates: "1500.34", //逾期利息
          startDate: "2019/12/04",
          endDate: "2020/12/04",
          type: "1" // 0 正常 1 已逾期 2 已还清
        },
        {
          lendMoney: "300000",
          remain: "200000",
          startDate: "2019/12/04",
          endDate: "2020/12/04",
          type: "0"
        },
        {
          lendMoney: "300000",
          startDate: "2019/12/04",
          endDate: "2020/12/04",
          type: "2"
        }
      ],
      listNo:[
        {
          id:1,
          money:'30000', //借款
          date:'2016-11-16', //时间
          type:'1' //1 待确认放款 2 审核中 3 未通过 4 已取消
        },
        {
          id:2,
          money:'30000', //借款
          date:'2016-11-10', //时间
          type:'2' //1 待确认放款 2 审核中 3 未通过 4 已取消
        },
        {
          id:3,
          money:'30000', //借款
          date:'2016-07-16', //时间
          type:'3' //1 待确认放款 2 审核中 3 未通过 4 已取消
        },
        {
          id:4,
          money:'30000', //借款
          date:'2016-11-16', //时间
          type:'4' //1 待确认放款 2 审核中 3 未通过 4 已取消
        }
      ]
    };
  },
  created() {},
  mounted() {},
  watch: {},
  computed: {}
};
</script>

<style lang="scss" scoped>
@import "./index.scss";
</style>

